<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                <meta name="description" content="Instaright Social Bookmarking app and recommendation engine. Discover, save and share trending articles while increasing your productivity." />
                <meta name="keywords" content="Instaright, discover, social discovery, share, social recommendation, read, read it later, download instaright firefox addon, instaright chrome extension, Instapaper addon firefox,instapaper chrome extension, export delicious bookmarks to instapaper" />
		<meta name="fragment" content="!" />
		<meta name="title" content="Instaright Social Bookmarking and recommendation app" />
		<meta name="msvalidate.01" content="528D5BB57C5DA4E8D9687FC13298CDC9" />
		<META name="y_key" content="a62335d350422a9a" />
		<link rel="alternate" type="application/rss+xml" title="Instaright RSS Feed" href="http://feeds.feedburner.com/InstarightFeed" />
		<link rel="alternate" type="application/atom+xml" title="Instaright Blog RSS Feed" href="http://feeds.feedburner.com/InstarightBlog" />
                <link rel="stylesheet" type="text/css" href="css/style.css" />
                <!--script src="http://www.google.com/jsapi?key=AIzaSyDu78p4P0qEe3CTU4GssVBz_crZemld_eg" type="text/javascript" charset="utf-8"></script>
                <script src='static/javascript/channel.js'></script-->
		<script type="text/javascript" src="/_ah/channel/jsapi"></script>
                <script type="text/javascript" src='static/javascript/invite.js'></script>
                <script type="text/javascript" src='static/javascript/instaright.js'></script>
                <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
                <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
                <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>

		<!-- fancybox -->
		<script type="text/javascript" src="/static/javascript/jquery.fancybox-1.3.4.pack.js"></script>
		<link rel="stylesheet" href="/css/jquery.fancybox-1.3.4.css" type="text/css" media="screen" />
                <title>Instaright - SocialBookmarking and recommendation engine</title>

                <!-- google analytics -->
                <script type="text/javascript">

                        var _gaq = _gaq || [];
                        _gaq.push(['_setAccount', 'UA-9005862-5']);
                        _gaq.push(['_trackPageview']);

                        (function() {
                         var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                         ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                         var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
                         })();
                 </script>
                 <!-- Google Website Optimizer Tracking Script -->
         </head>
         <body>
		<script type="text/javascript" charset="utf-8">
		$(document).ready(function(){
			var show_login='{{ show_login }}';
			$("#btn_login").fancybox({
				'scrolling'		: 'no',
				'titleShow'		: false,
			});
			if (show_login){
				$("#btn_login").fancybox({
					'scrolling'		: 'no',
					'titleShow'		: false,
				}).trigger('click');
			}
		});
		</script>
                <script type="text/javascript" charset="utf-8">
                         if( !window.XMLHttpRequest ) XMLHttpRequest = function(){
        			try{ return new ActiveXObject("Msxml2.XMLHTTP.6.0") }catch(e){}
        			try{ return new ActiveXObject("Msxml2.XMLHTTP.3.0") }catch(e){}
        			try{ return new ActiveXObject("Msxml2.XMLHTTP") }catch(e){}
        			try{ return new ActiveXObject("Microsoft.XMLHTTP") }catch(e){}
        			throw new Error("Could not find an XMLHttpRequest alternative.")
			};
			var channel_id= '{{ channel_id }}';
			var channel = new goog.appengine.Channel(channel_id);
			var socket = channel.open();
			var maxElementsInStream=6;
			var maxHotLinks = 3;
			socket.onopen = function(){
				//alert('connected:{{ channel_id }}');
			}
			socket.onmessage = function(evt){
        			try{
                			feed_json_update = JSON.parse(evt.data);
                			updateDisplayEntry(feed_json_update, stream);
        			} catch(e){
         			        //alert('eee:'+e);
        			} 
			};
			socket.onclose= function(evt){
				//alert('close:'+evt);
			};
			socket.onerror = function(evt){
				//alert('error:'+JSON.parse(evt.data));
			};

			$(document).ready(function(){
				$("#stream_loader").hide();
				$("#invite_jid").bind('keypress', function(e){
					if (e.keyCode == 13){
					check_and_send_jid();
					}
				});
				$("#invite_jid").focus(function(){
					$(this).val("");
				});
				$.get('/feed?format=json', {}, updateDisplayEntry);
				$("#jid_result").hide();
				$("#invite_jid").focus();
                	});

			//$(#stream").ajaxStart(function(){
			//	$("#stream_loader").show();
			//});
			//$("#stream").ajaxStop(function(){
			//	$("#stream_loader").hide();
			//});
			// Create variables to display subscription options using HTML DIVs

			var stream = document.getElementById('stream');

			// Initialize the API.
			var feed;
			function updateDisplayEntry(response, div) {
        			try{
                			div = document.getElementById('stream');
					// TODO update timestamps after feed update
                			for (i = response.length - 1; i >= 0; i--) {
                        			e = response[i]['u'];
                        			domain = e['d'];
                        			instaright_domain = e['dd'];
                        			try{
                                			title=e['t'];
                        			}catch(e){
                                			title="Instaright article from domain "+domain;
                        			}
						orig_title = title;
                        			if (title == null || title == 'None' || title == 'null' || title.length == 0){
                                			title="Instaright article from domain "+domain;
                        			} else {
                                			try{
                                				if ((title.charCodeAt(0) > 256 || title.charCodeAt(title.length/2) > 256)   && title.length >= 40){
                                        				title = title.substr(0,37) + ' ...';
                                				}
                                				else if (title.length >= 70){
                                        				title = title.substr(0,67) + ' ...';
                                				}
                                			} catch(e){
                                			}
                        			}
                        			link = e['l'];
						dateUpdated_int=parseInt(e['u']) * 1000;
						dateUpdated = new Date(dateUpdated_int);
                        			id = e['id'];
						a = e['a'];
						lc = e['lc'];
						html_lc = e['html_lc'];
						c=e['c']
						source = e['source'];

                        			original_url = e['ol'];
						embeded = e['e'];

						updated_ago_string = "<a href=\""+link+"\">as seen "+updated_string(dateUpdated)+" on "+ source+"</a>";
                        			container = document.createElement('div');
                        			containerAvatar = document.createElement('div');
						containerAvatar.setAttribute('class', 'avatar_div');

                        			avatarElement = document.createElement('img');
                        			avatarElement.setAttribute('src', a);
                        			avatarElement.setAttribute('class', 'avatar');

                        			containerAvatar.appendChild(avatarElement);
                        			container.setAttribute('class', 'streamcontent');
                        			container.setAttribute('id', id);

                        			titleElement = document.createElement('a');
						titleElement.setAttribute('class','stream-article');
						titleElement.setAttribute('title', orig_title);
						titleElement.setAttribute('rel', 'nofollow');
                        			titleElement.innerHTML = title;
                                		titleElement.href = original_url;
                        			titleElement.target="_new"
                        			titleParagraph = document.createElement('p');
                        			titleParagraph.appendChild(titleElement);

                        			domainElement = document.createElement('a');
						domainElement.className="stream-article";
                        			domainElement.innerHTML = domain;
                        			domainElement.href = instaright_domain;
                        			domainElement.target="_new"

                        			container.appendChild(containerAvatar);
                        			container.appendChild(titleParagraph);
                        			container.appendChild(document.createElement('br'));
                        			container.appendChild(domainElement);
                        			container.appendChild(document.createElement('br'));

                        			embededParagraph = document.createElement('div');
						embededParagraph.setAttribute('class', 'embeded_content');
						if (typeof(embeded) != 'undefined' && embeded != null && embeded.length > 0){
							//alert(embeded);
							embededParagraph.innerHTML = embeded;
							container.appendChild(embededParagraph);
                        				container.appendChild(document.createElement('br'));
						}
                        			contentParagraph = document.createElement('div');
						contentParagraph.setAttribute('class','category_div');
						/*if (typeof(lc) !== 'undefined' && lc != null && lc != 'null' && lc.length > 1){
							try{
								cats=lc.split(',');
								span_cats=Array();
								for (c in cats){
									span_cats.push("<span class=\"text_bubble_cats\"><a href=\"/category/"+cats[c]+"\">"+cats[c]+"</a></span>");
								}
							}catch(e){
								span_cats=Array();
							}
							
							contentParagraph.innerHTML = span_cats.join(" ");
						}*/ 
						contentParagraph.innerHTML = html_lc;
						contentParagraph_footer = document.createElement('div');
						contentParagraph_footer.setAttribute('class', 'content_footer');
						contentParagraph_footer.setAttribute('info', dateUpdated_int)
						contentParagraph_footer.setAttribute('source_info', source);
						contentParagraph_footer.innerHTML = updated_ago_string;

                        			domainParagraph = document.createElement('p');
                        			domainParagraph.innerHTML = domainElement;

                        			container.appendChild(contentParagraph);
						container.appendChild(contentParagraph_footer);
                       
                        			div.insertBefore(container, div.firstChild);
                        			$("#"+id).hide();
                        			$("#"+id).show('blind');
                        			sElements = $("#stream").children();
                        			if (sElements.length > maxElementsInStream ){
                                			lastElement = sElements.get(-1); 
                                			last_id = lastElement.getAttribute('id');
                                			//alert('id:'+ id);
                                			$("#"+last_id).hide();
                                			div.removeChild(lastElement);
                        			}
						
                			}
					// adjust image width
					$(".embeded_content a img").load(function(){
									var max_width = 480;
									var w = $(this).width();
									var h = $(this).height();
									if (w > max_width){
										var r = w/h;
										$(this).css('height', max_width/r);
										$(this).css('width', max_width);
									}
					});
					// adjust times
					$(".content_footer").each(function(){
							milis = $(this).attr('info');
							current_source = $(this).attr('source_info');
							dateForUpdate=new Date(parseInt(milis));
							if (window.console && window.console.log){
								console.log('current link text:' + $(this).find('a').text());
								console.log('milis:'+ milis);
								console.log('date for update :'+ dateForUpdate);
							}
							updated_ago_string = "as seen "+updated_string(dateForUpdate)+" on "+ current_source;
							if (window.console && window.console.log){
								console.log('updated link text:'+ updated_ago_string);
							}
							$(this).find("a").text(updated_ago_string);
					}); 

        			}catch(e){
                			alert("while adding new element :" +e);
        			}
			}
</script>


<div class="wrapper"> 
	<div id="nav" >
		<div class="center clearfix">
			<h5><a href="/" alt="Instaright - Social Bookmarks and Recommendation Engine" title="Instaright - Social Bookmarks and Recommendation Engine">Instaright - Perfect information for you in realtime.</a></h5>
                <ul class="menu borderless clearfix"> 
			<li><a href="/category" title="Instaright most popular category list"><span>Categories</span></a></li>
			<li><a href="/tools" title="Instaright tools"><span>Tools</span></a></li>
                        {% if user %}
			<li><a href="/user/dashboard"><span>{{ user }}</span></a></li>
			<li><a href="/user/dashboard"><img src="{{ avatar }}" width="20" height="20" alt="Instaright user {{ user }} avatar" /></a></li>
			<li><a href="{{ logout_url }}"><span>Logout</span></a></li>
                        {% else %}
			<li><a id="btn_login" href="/account" title="Login to Instaright"><span>Login</span></a></li>
                        {% endif %}
                        <li>
                        </li>

                </ul>
		</div>
	</div>
        <div id="content" class="container_24"> 
                <div id="left_col" class="grid_18"> 
                        <div class="left_box_top"> 
                                <h2 class="round_title"> 
					<span><a href='/' alt='Instaright Realtime Updates' title='Instaright Social Bookmarks and Recommendation Engine'>Instaright Stream</a></span> 
                                </h2> 
                        </div> 
                        <div class="left_box_mid">
				<div id="stream_loader"><p><img src="/static/images/loader.gif" alt="Instaright Stream Loading"/> Loading Stream ...</p></div>
				<div id="stream"><div id="stream_loader"><p><img src="/static/images/loader.gif" alt="Instaright Stream Loading"/> Loading Stream ...</p></div></div>
                        </div>
			<div class="left_bot_mid">
				<div class="left_bot_left"></div>
				<div class="left_bot_center"></div>
			</div>
                </div>
                <div id="right_col" class="grid_6">
			<div id="right_box_top">
			</div>
                        <div id="right_box_mid">
				{% include 'right_mid.html' %}
			</div>
			<div id="right_box_bot">
			</div>
		</div>
		<div class="clear"></div> 
		<div class="push"></div> 
	</div>
	<div class="clearfix"></div> 
</div>

<div class="clearfix"></div> 
{% include 'footer.html' %}
<!-- GETSATISFACTION -->
<!-- IMPORTANT: bad for user experience  
<script type="text/javascript" charset="utf-8">
	var is_ssl = ("https:" == document.location.protocol);
	var asset_host = is_ssl ? "https://s3.amazonaws.com/getsatisfaction.com/" : "http://s3.amazonaws.com/getsatisfaction.com/";
	document.write(unescape("%3Cscript src='" + asset_host + "javascripts/feedback-v2.js' type='text/javascript'%3E%3C/script%3E"));
	</script>

	<script type="text/javascript" charset="utf-8">
		var feedback_widget_options = {};

		feedback_widget_options.display = "overlay";  
		feedback_widget_options.company = "instaright";
		feedback_widget_options.placement = "left";
		feedback_widget_options.color = "#222";
		feedback_widget_options.style = "idea";
		var feedback_widget = new GSFN.feedback_widget(feedback_widget_options);
		</script-->
		<!-- End GETSATISFACTION -->
		<!-- Google Website Optimizer Tracking Script -->
		<script type="text/javascript">
			if(typeof(_gat)!='object')document.write('<sc'+'ript src="http'+
					(document.location.protocol=='https:'?'s://ssl':'://www')+
					'.google-analytics.com/ga.js"></sc'+'ript>')</script>
				<script type="text/javascript">
					try {
						var gwoTracker=_gat._getTracker("UA-9005862-6");
						gwoTracker._trackPageview("/2188815013/test");
					}catch(err){}
</script>
<!-- End of Google Website Optimizer Tracking Script -->
<noscript>
	<h1>Instaright Realtime Bookmarking and recommendation engine<h1>
			<h2>Instaright Categories</h2>
			<h3>Following Instaright categories</h3><p> are most popular over internet</p>
			<p>
			<h5>Apple<h5>
					<a href="http://www.instaright.com/category/apple" title="Instaright category - apple">Instaright category - Apple</a>
					<h5>Hacking<h5>
							<a href="http://www.instaright.com/category/hack" title="Instaright category - hack">Instaright category - Hack</a>
							<h5>Steve Jobs<h5>
									<a href="http://www.instaright.com/category/stevejobs" title="Instaright category - steve jobs">Instaright category - Steve Jobs</a>
									<h5>Wealth<h5>
											<a href="http://www.instaright.com/category/wealth" title="Instaright category - wealth">Instaright category - Wealth</a>
											<h5>Culture<h5>
													<a href="http://www.instaright.com/category/cultutre" title="Instaright category - cultutre">Instaright category - cultutre</a>
													<h5>Computer<h5>
															<a href="http://www.instaright.com/category/computer" title="Instaright category - computer">Instaright category - computer</a>
															<h5>Design<h5>
																	<a href="http://www.instaright.com/category/design" title="Instaright category - design">Instaright category - design</a>
																	<h5>World<h5>
																			<a href="http://www.instaright.com/category/world" title="Instaright category - world">Instaright category - world</a>
																			<h5>Politics<h5>
																					<a href="http://www.instaright.com/category/politics" title="Instaright category - politics">Instaright category - politics</a>
																					<h5>Crime<h5>
																							<a href="http://www.instaright.com/category/crime" title="Instaright category - crime">Instaright category - crime</a>
																							<h5>Technology<h5>
																									<a href="http://www.instaright.com/category/technology" title="Instaright category - technology">Instaright category - technology</a>
																									<h5>Tutorial<h5>
																											<a href="http://www.instaright.com/category/tutorial" title="Instaright category - tutorial">Instaright category - tutorial</a>
																											<h5>Toread<h5>
																													<a href="http://www.instaright.com/category/toread" title="Instaright category - toread">Instaright category - toread</a>
																													<h5>Arts<h5>
																															<a href="http://www.instaright.com/category/arts" title="Instaright category - arts">Instaright category - arts</a>
																															<h5>Psychology<h5>
																																	<a href="http://www.instaright.com/category/psychology" title="Instaright category - psychology">Instaright category - psychology</a>
																																	<h5>Entertainment<h5>
																																			<a href="http://www.instaright.com/category/entertainment" title="Instaright category - entertainment">Instaright category - entertainment</a>
																																			<h5>Sports<h5>
																																					<a href="http://www.instaright.com/category/sports" title="Instaright category - sports">Instaright category - sports</a>
																																					<h5>Religion<h5>
																																							<a href="http://www.instaright.com/category/religion" title="Instaright category - religion">Instaright category - religion</a>
																																							<h5>Health<h5>
																																									<a href="http://www.instaright.com/category/health" title="Instaright category - health">Instaright category - health</a>
																																									<h5>Internet<h5>
																																											<a href="http://www.instaright.com/category/internet" title="Instaright category - internet">Instaright category - internet</a>
																																											<p>Check out more Instaright Articles<p><a href="http://www.instaright.com/feed?out=json" title="Instaright Article Feed">Instaright Article Feed</a></p></p>
																																											</p>
																																										</noscript>


																																									</body>
																																								</html>
